<?php

class TiposController extends AppController {

    public $layout = 'default';
    public $name = 'Tipos';
    public $uses = array('Tipo');
    public $helpers = array('Html', 'Form');
    public $components = array('Session');

    public function index() {
        $tipos = $this->paginate('Tipo');
        $this->set(compact('tipos'));
    }

    function add() {

        if (!empty($this->data)){
            $this->Producto->create();
            if ($this->Producto->save($this->data)) {
                $this->Session->setFlash('Cliente registrado con exito');
                $this->redirect(array('action' => 'index'), null, true);
            } else {
                $this->Session->setFlash('No se pudo registrar!');
            }
        }else{
            //$rutas = $this->Ruta->find('list', array("fields" => array("Ruta.id", "Ruta.nombreruta")));
            //$this->set(compact('rutas'));
        }
    }

}

?>